using Core;
using UnityEngine;

namespace g_gongjianta
{
    public class MonsterMoveComponent : UnitComponent<Monster>, ILateUpdate
    {
        public void LateUpdate()
        {
            var dir = Unit.Data.MoveDir;
            if (dir == Vector2.zero)
            {
                return;
            }

            Unit.Dir = dir;
            Unit.Pos += dir * Unit.Conf.Speed * Time.deltaTime;
        }
    }
}